package com.hexingmo.dawn.lang;

import lombok.Data;
import lombok.Getter;

import java.math.BigInteger;

public class IPRange {

    private final String startIP;

    private final String endIP;
    private final long startLong;
    private final long endLong;
    private final BigInteger startBigInt;
    private final BigInteger endBigInt;
    private final IPVersion version;

    public IPRange(String startIP, String endIP, long startLong, long endLong,
                         BigInteger startBigInt, BigInteger endBigInt, IPVersion version) {
        this.startIP = startIP;
        this.endIP = endIP;
        this.startLong = startLong;
        this.endLong = endLong;
        this.startBigInt = startBigInt;
        this.endBigInt = endBigInt;
        this.version = version;
    }

    public String getStartIP() {
        return startIP;
    }

    public String getEndIP() {
        return endIP;
    }

    public long getStartLong() {
        return startLong;
    }

    public long getEndLong() {
        return endLong;
    }

    public BigInteger getStartBigInt() {
        return startBigInt;
    }

    public BigInteger getEndBigInt() {
        return endBigInt;
    }

    public IPVersion getVersion() {
        return version;
    }

    @Override
    public String toString() {
        return String.format("IP Range: %s - %s (%s)", startIP, endIP, version);
    }
}
